<template>
  <div class="root">
    <span>{{ name }}</span>
    <span v-if="need" class="need">*</span>
  </div>
</template>

<script>
export default {
  name: "Label",
  props: {
    name: {
      type: String,
      default: "字段名",
    },
    need: {
      type: Boolean,
      default: false,
    },
  },
};
</script>

<style scoped lang="less">
.root {
  height: 30px;
  width: 78px;
  min-width: 78px;
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  color: "#565E66";
  background-color: #fff;
  margin-right: 10px;
  font-size: 12px;
}
.need {
  color: #ff475a;
  margin-right: 6px;
}
</style>